package com.okami.controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.concurrent.locks.ReentrantLock;

/**
 * @author: TanJingyu
 * @create: 2021-02-03 14:32
 **/
@RestController
@RequestMapping("/lock")
public class LockController {
    private ReentrantLock lock = new ReentrantLock();

    @GetMapping
    public String lock() {
        lock.lock();
        return "your name";
    }
}
